.class public Lcom/glympse/platform/Config;
.super Lcom/glympse/platform/common/ConfigBase;
.source "Config.java"


# static fields
.field public static final ELocationProvider_BuiltIn:I = 0x0

.field public static final ELocationProvider_Simulator:I = -0x1

.field public static final ELocationProvider_Skyhook:I = 0x1

.field public static final ELocationProvider_Verizon:I = 0x2


# instance fields
.field public m_eLocProviderPersist:I

.field public m_eLocProviderThisRun:I

.field public m_lFacebookExpires:J

.field public m_strFacebookToken:Ljava/lang/String;

.field public m_strSkyhookName:Ljava/lang/String;

.field public m_strTwitterPassword:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 3

    .prologue
    const/4 v0, 0x0

    const/4 v2, 0x0

    .line 17
    invoke-direct {p0}, Lcom/glympse/platform/common/ConfigBase;-><init>()V

    .line 24
    iput-object v2, p0, Lcom/glympse/platform/Config;->m_strSkyhookName:Ljava/lang/String;

    .line 27
    iput v0, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    .line 28
    iput v0, p0, Lcom/glympse/platform/Config;->m_eLocProviderThisRun:I

    .line 30
    iput-object v2, p0, Lcom/glympse/platform/Config;->m_strFacebookToken:Ljava/lang/String;

    .line 31
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/glympse/platform/Config;->m_lFacebookExpires:J

    .line 33
    iput-object v2, p0, Lcom/glympse/platform/Config;->m_strTwitterPassword:Ljava/lang/String;

    .line 17
    return-void
.end method


# virtual methods
.method public ClearFacebookCredentials()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 144
    iput-object v2, p0, Lcom/glympse/platform/Config;->m_strFacebookName:Ljava/lang/String;

    .line 145
    const-wide/16 v0, 0x0

    invoke-virtual {p0, v2, v0, v1}, Lcom/glympse/platform/Config;->SetFacebookToken(Ljava/lang/String;J)V

    .line 146
    return-void
.end method

.method public Load()V
    .locals 3

    .prologue
    .line 39
    invoke-super {p0}, Lcom/glympse/platform/common/ConfigBase;->Load()V

    .line 41
    const/4 v0, 0x0

    .line 44
    .local v0, fChanged:Z
    iget v1, p0, Lcom/glympse/platform/Config;->m_nFileBuild:I

    const/16 v2, 0x51

    if-ge v1, v2, :cond_0

    const/4 v1, 0x1

    iget v2, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    if-ne v1, v2, :cond_0

    .line 46
    const-string v1, "Previous build is less than 81, forcing Skyhook off"

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 47
    const/4 v1, 0x0

    iput v1, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    .line 48
    const/4 v0, 0x1

    .line 50
    :cond_0
    iget v1, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    iput v1, p0, Lcom/glympse/platform/Config;->m_eLocProviderThisRun:I

    .line 53
    if-eqz v0, :cond_1

    .line 55
    invoke-virtual {p0}, Lcom/glympse/platform/Config;->Save()V

    .line 57
    :cond_1
    return-void
.end method

.method public LoadLine(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 4
    .parameter "strName"
    .parameter "strValue"

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x1

    .line 62
    const-string v0, "UseSkyhook"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 64
    invoke-static {p2}, Lcom/glympse/platform/common/Helpers;->ParseInt(Ljava/lang/String;)I

    move-result v0

    if-lez v0, :cond_0

    .line 66
    iput v2, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    :cond_0
    :goto_0
    move v0, v2

    .line 101
    :goto_1
    return v0

    .line 69
    :cond_1
    const-string v0, "LocationProvider"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    .line 71
    invoke-static {p2}, Lcom/glympse/platform/common/Helpers;->ParseInt(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    .line 72
    iget v0, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    if-ne v2, v0, :cond_2

    sget-boolean v0, Lcom/glympse/platform/ProviderSkyhook;->SKYHOOK_SUPPORTED:Z

    if-nez v0, :cond_0

    .line 73
    :cond_2
    const/4 v0, 0x2

    iget v1, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    if-ne v0, v1, :cond_3

    invoke-static {}, Lcom/glympse/platform/ProviderVerizon;->AllowVerizon()Z

    move-result v0

    if-nez v0, :cond_0

    .line 75
    :cond_3
    iput v3, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    goto :goto_0

    .line 78
    :cond_4
    const-string v0, "SkyhookName"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_5

    .line 80
    iput-object p2, p0, Lcom/glympse/platform/Config;->m_strSkyhookName:Ljava/lang/String;

    goto :goto_0

    .line 82
    :cond_5
    const-string v0, "FacebookToken"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_6

    .line 84
    iput-object p2, p0, Lcom/glympse/platform/Config;->m_strFacebookToken:Ljava/lang/String;

    goto :goto_0

    .line 86
    :cond_6
    const-string v0, "FacebookExpires"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_7

    .line 88
    invoke-static {p2}, Lcom/glympse/platform/common/Helpers;->ParseLong(Ljava/lang/String;)J

    move-result-wide v0

    iput-wide v0, p0, Lcom/glympse/platform/Config;->m_lFacebookExpires:J

    goto :goto_0

    .line 90
    :cond_7
    const-string v0, "TwitterPassword"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_8

    .line 92
    iput-object p2, p0, Lcom/glympse/platform/Config;->m_strTwitterPassword:Ljava/lang/String;

    goto :goto_0

    .line 94
    :cond_8
    invoke-super {p0, p1, p2}, Lcom/glympse/platform/common/ConfigBase;->LoadLine(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    move v0, v3

    .line 99
    goto :goto_1
.end method

.method protected Save(Lcom/glympse/platform/GFile;)V
    .locals 4
    .parameter "oGFile"

    .prologue
    .line 108
    invoke-super {p0, p1}, Lcom/glympse/platform/common/ConfigBase;->Save(Lcom/glympse/platform/GFile;)V

    .line 111
    iget v0, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    if-eqz v0, :cond_0

    .line 113
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "LocationProvider:"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v1, p0, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Lcom/glympse/platform/GFile;->WriteLine(Ljava/lang/String;)Z

    .line 117
    :cond_0
    iget-object v0, p0, Lcom/glympse/platform/Config;->m_strSkyhookName:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 119
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "SkyhookName:\""

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lcom/glympse/platform/Config;->m_strSkyhookName:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->EncodeProtocolString(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "\""

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Lcom/glympse/platform/GFile;->WriteLine(Ljava/lang/String;)Z

    .line 123
    :cond_1
    iget-object v0, p0, Lcom/glympse/platform/Config;->m_strFacebookToken:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_2

    .line 125
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "FacebookToken:\""

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lcom/glympse/platform/Config;->m_strFacebookToken:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->EncodeProtocolString(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "\""

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Lcom/glympse/platform/GFile;->WriteLine(Ljava/lang/String;)Z

    .line 127
    :cond_2
    iget-wide v0, p0, Lcom/glympse/platform/Config;->m_lFacebookExpires:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-eqz v0, :cond_3

    .line 129
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "FacebookExpires:"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-wide v1, p0, Lcom/glympse/platform/Config;->m_lFacebookExpires:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Lcom/glympse/platform/GFile;->WriteLine(Ljava/lang/String;)Z

    .line 131
    :cond_3
    return-void
.end method

.method public SetFacebookToken(Ljava/lang/String;J)V
    .locals 0
    .parameter "strToken"
    .parameter "lExpires"

    .prologue
    .line 136
    iput-object p1, p0, Lcom/glympse/platform/Config;->m_strFacebookToken:Ljava/lang/String;

    .line 137
    iput-wide p2, p0, Lcom/glympse/platform/Config;->m_lFacebookExpires:J

    .line 138
    invoke-virtual {p0}, Lcom/glympse/platform/Config;->Save()V

    .line 139
    return-void
.end method

.method public WipeAccount()V
    .locals 1

    .prologue
    .line 151
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/platform/Config;->m_strSkyhookName:Ljava/lang/String;

    .line 152
    invoke-super {p0}, Lcom/glympse/platform/common/ConfigBase;->WipeAccount()V

    .line 153
    return-void
.end method
